package com.kakarote.admin.entity.BO;

import com.kakarote.common.log.enums.ApplyEnum;
import com.kakarote.common.log.enums.OperateObjectEnum;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author: admin
 * @version: v1.0
 * @date:2023/9/2
 */
@Data
@ApiModel("附件BO")
public class AttachmentBO {

    private MultipartFile file;

    private String batchId;

    private Long fileId;

    private String type;

    private Integer apply;

    private Integer label;

    private String typeName;

    private Long typeId;


    //检查数据
    public boolean checkData() {
        if (typeId == null || typeName == null) {
            return false;
        }
        ApplyEnum parse = ApplyEnum.parse(apply);
        if (parse == ApplyEnum.NULL) {
            return false;
        }
        OperateObjectEnum operateObjectEnum = OperateObjectEnum.parse(label, apply);
        if (operateObjectEnum == OperateObjectEnum.NULL) {
            return false;
        }
        return true;
    }

}
